<?php
if(!isset($_SESSION)) 
{ 
session_start(); 
} 
include '../connection/connection.php';
include "../value/value_kr.php";
$winH = $_REQUEST['winH'];

	$list=$_SESSION['sort'];
	$str=$_GET['str'];
	$_SESSION['sortn']=$str;
	$flagDesc=$_GET['flagDesc'];
	
	if(!isset($_REQUEST['page'])){
		$list["cf.id"]="DESC";
		$list["cf.name"]="DESC";

		$str="cf.id";
		
		$_SESSION['sortn']=$str;
		$_SESSION['sort']=$list;
	}else{
		$str=$_SESSION['sortn'];
		$list=$_SESSION['sort'];
	}
	
	$sql1 = "SELECT cf.id,cf.`name` FROM `configcamera` cf";
	$selectallcamenra = mysql_query($sql1." ORDER BY ".$str." ".$list[$str],$connection);
	$_SESSION['sort']=$list;
?>
<div id="divscroll" style="overflow:scroll;overflow-x: hidden; width:100%; height:<?php echo ($winH-180)."px"?>; background-color: #ffffff">
	                <table  class="tbchung1"  cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-top:0" id="tablebody">
		                 <tbody>
		                    <?php $i=0;
		                		 while ($row = mysql_fetch_array($selectallcamenra)){ $i++;?>
		                    <tr style="background: <?php if ($i%2==0) {echo '#ffffff';} else {echo "#eff3fa";}?>"  id="rowcameraright" onclick="clickRowTable(this,<?=$row[id]?>)">
		                        <td style="width: 10%"><?=$i;?></td>
		                        <td style="width: 15%"><?=$row[id]?></td>
		                        <td class="last" style="width: 75%"><?=$row[name]?></td>                   
		                    </tr>
		                  <?php 
							}
							if ($i>0 and $i<($winH/28)) {
							 	foreach(range(0,intval($winH/28)-$i) as $real){
							 		?>
							 		<tr>
								 	<td style="width:10% !important">&nbsp;</td>
								 	<td style="width:15% !important">&nbsp;</td>
								 	<td  class="last" style="width: 75%;border-right: none !important;">&nbsp;</td>
								 	</tr>
							 	<?php }
							}?>
	                    </tbody>
	                </table>
                </div>